import 'package:get/get.dart';

import '../../services/address.dart';
import '../../services/dio_manager.dart';
import 'attendance_model.dart';

class SignController extends GetxController{


  AttendanceModel? model;

  var basicData;

  requestData()async{
    var params ={
      'date_type':'week',
      'start_date':'',
      'end_date':'',
    };
    var json = await DioManager().kkRequest(Address.hrAttendanceStaticRead,method: 'get',params: params);

    AttendanceModel _model = AttendanceModel.fromJson(json);

    model = _model;

    basicData = [
      {'genre': '出勤', 'sold': model?.data?.attendDays},
      {'genre': '未出勤', 'sold': model?.data?.notAttendDays},
      // {'genre': 'Action', 'sold': 120},
      // {'genre': 'Shooter', 'sold': 350},
      // {'genre': 'Other', 'sold': 150},
    ];

    update();

  }


  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    requestData();
  }
}